<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../../../assets/css/base.css">
  <style>
    .flex-container {
      display: flex;
      width: 400px;
      height: 300px;
      border: 1px solid black;
    }

    .flex-container>div {
      /*
        align-self 交叉轴方向 子元素在行内的对齐方式 在子元素上设置该属性
         ● center
         ● start
         ● end
         ● stretch
       */
      align-self: center;
      width: 100px;
      color: white;
      font-size: 20px;
      line-height: 100px;
      text-align: center;
    }

    .flex-container>div:nth-child(1) {
      background-color: red;
    }

    .flex-container>div:nth-child(2) {
      background-color: orange;
    }

    .flex-container>div:nth-child(3) {
      background-color: green;
    }

    .flex-container>div:nth-child(4) {
      background-color: blue;
    }

    .start {
      align-self: start !important;
    }

    .center {
      align-self: center !important;
    }

    .end {
      align-self: end !important;
    }

    .stretch {
      align-self: stretch !important;
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10">
    <div class="flex-container">
      <div class="start">start</div>
      <div class="center">center</div>
      <div class="end">end</div>
      <div class="stretch">stretch</div>
    </div>
  </div>
</body>

</html>